package com.day1011;

import java.io.Serializable;

public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    private String name;
    private int age;
    private int phonenumber;

    public User(String name, int age, int phonenumber) {
        this.name = name;
        this.age = age;
        this.phonenumber = phonenumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getPhonenumber() {
        return phonenumber;
    }

    public void setPhonenumber(int phonenumber) {
        this.phonenumber = phonenumber;
    }

    @Override
    public String toString() {
        // 返回你需要的字段信息，格式可自定义
        return "User{" +
                "name='" + name + '\'' +  // 姓名
                ", age=" + age +         // 年龄
                ", id=" + phonenumber +  // ID
                '}';
    }
}

